import React, { Component } from 'react'
import qs from 'qs'
import auth from './auth'

class Home extends Component {
  login = () => {
    // 执行登录
    auth.login()
    console.log(auth.isAuthorized())
    alert('登录成功')
  }
  render() {
    console.log(qs.parse(this.props.location.search, {ignoreQueryPrefix: true}))
    return (
      <div className="Home">
        Home
        <button onClick={this.login}>点我登录</button>
      </div>
    );
  }
}

export default Home;
